N4CID08N4CIE16N4CIF24MODBUSRTU Commamd
MODBUS command (function code, write 06/16, read 04/03)
Note :
1 MODBUS command must be HEX
2 Slave address (device address) must be the same as the setting. You can also use this command to query the current device address: FF 03 00 FD 00 01 00 24 3 The Baudrate and parity should be consistent
Command overview:
Channels |
SKU |
Product ID |
Channel assignment |
16 |
N4CID08 |
2508 |
CH1-CH8 : 0-20MA |
32 |
N4CIE16 |
2516 |
CH1-CH15 : 0-20MA CH16 : 0-30V |
48 |
N4CIF24 |
2524 |
CH1-CH22 : 0-20MA CH23-CH24 : 0-30V |
Supported function codes:
Function Code |
Modbus Address (PLC) |
Register Address |
Describe |
|
04: |
30001 |
0x0000-0x00017 (0-23) Unit: 0.01MA/0.01V |
N4CID08: 0x0000-0x0007 |
: 0-20MA |
N4CIE16: 0x0000-0x000E |
: 0-20MA |
|||
|
|
|
0x000F |
: 0-30V |
N4CIF24: 0x0000-0x0015 |
: 0-20MA |
|||
|
|
|
0x0016-0x0017 |
: 0-30V |
03 |
40001 |
|
|
|
0x0080-0x00FF (128-255) |
Read special function registers (baud rate 485 address, etc.) |
|||
06 |
40001 |
|
|
|
0x0080-0x00FF (128-255) |
Write a single special function register (baud rate 485 address, etc.) |
|||
16(0x10) |
40001 |
|
|
|
0x0080-0x00FF (128-255) |
Write multiple special function registers (baud rate 485 address, etc.) |
All states are mapped into 4xxxx range registers. The user can monitor the input and output status of the module by reading or modifying the value of the 4xxxx interval register (03 06
16 function code)
Register address |
Register contents |
Register value |
Remarks |
R/W |
0x00A0-0x00B7 (160-183) |
AI analog input Current unit: 0.01ma Voltage unit: 0.01V |
N4CID08: 0x00A0-0x00A7 : 0-20MA |
R |
|
N4CIE16: 0x00A0-0x00AE : 0-20MA 0x00AF : 0-30V |
|
|||
N4CIF24: 0x00A0-0x00B5 : 0-20MA 0x00B6-0x00B7 : 0-30V |
|
|||
0x00C0-0x00D7 (192-215) |
This value can be corrected when the current reading deviation is greater than 1%, such as: 1000 means 1:1 1010: 1% increase 990: 1% decrease |
R/W |
||
|
|
|
|
|
0X00F6 (246) |
AI analog automatic reporting Registers (160-167) are automatically reported |
0: Query function (default) 1-255: Automatically report, the unit is second. 1: Report every 1 second 2: Report every 2 seconds 10: Report every 10 seconds Maximum interval of 255 seconds |
|
|
0x00F7 (247) |
Product ID |
0-65535 |
SKU ID N4AIA08 2508 N4AIB16 2516 N4AIC24 2524 |
|
0x00FB (251) |
Factory Reset |
Factory Reset: 1 1 Short the RES jumper for 5 seconds 2 Enter the following command at the current baud rate: FF 06 00 FB 00 00 ED E5 |
R/W |
|
0x00FC (252) |
Command Return Time |
0-25 |
Time interval for command return (unit: 40MS) Setting value: 0-25 |
R/W |
0x00FD (253) |
RS485 address (Station address) |
Read address:FF 03 00 FD 00 01 00 24; Set address to 0x02: FF 06 00 FD 00 02 8C 25 |
R/W |
|
0x00FE (254) |
Baud rate |
0-255 |
0:1200 1:2400 2:4800 3:9600(default)4:19200 5:38400 6:57600 7:115200 Others:Factory reset |
R/W |
0x00FF (255) |
Parity |
0-2 |
0 None Parity 1 Even Parity |
R/W |
|
|
|
2 Odd Parity |
|
9600 Band ,8 Data bits,None Parity,1 Stop Bit。
MODBUS commands you can use "Modbus Poll" input, as shown below
(CRC check generated automatically)
You can also use HyperTerminal serial input, as shown below
(Manually add CRC check)
1.Read AI analog input value:
Send data
RS485 address (Station address) (1) |
Functio n (1) |
Register (2) |
|
address |
Read number (2) |
CRC16(2 ) |
Returns data |
|
|
|
|
|
|
RS485 address (Station address) (1) |
Functio n (1) |
Number (1) |
of |
bytes |
data (n) |
CRC16(2 ) |
Modbus Address(PLC):30001-30008
RS485 address : 0x01~0x3F
Function code: 0x04
Register address:0x0000-0x0007 Read number :0x0001-0x0008
Forexample,Readthe valueofAIanaloginputofchannel1-8 (channel 8 is 3.95MA, other channels are 0MA):
Send data(address 1): 01 04 00 00 00 08 F1 CC
Return data : 01 04 10 00 00 00 00 00 00 00 00 00 00 00 00 00
00 01 8B 14 DB
01 RS485 address, 04 function code, 10 length, 018B represents the value of channel 8, which is 395 in decimal, /100=3.95MA.
In addition, the AI analog input is also mapped to the 40000 interval register. The user can read the value of the AI analog input through the 03 function code.
Modbus Address(PLC):40161-40168
RS485 address : 0x01~0x3F
Function code:0x03
Register address:0x00A0-0x00A7 Read number: 0x0008
Forexample,Readthe valueofAIanaloginputofchannel1-8 (channel 8 is 3.95MA, other channels are 0MA):
Send data(address 1): 01 03 00 A0 00 08 44 2E
Return data : 01 03 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 8B A5 AE
01 RS485 address, 03 function code, 10 length, 018B represents the value of channel 8, which is 395 in decimal, /100=3.95MA.
2.Set the AI scale value (correction value) :
Send data
RS485 address (Station address) (1) |
Functio n (1) |
Register (2) |
|
address |
Read number (2) |
CRC16(2 ) |
Returns data |
|
|
|
|
|
|
RS485 address (Station address) (1) |
Functio n (1) |
Number (1) |
of |
bytes |
data (n) |
CRC16(2 ) |
Modbus Address(PLC):40193-40200
RS485 address : 0x01~0x3F
Function code:Write 0x06/0x10,Read 0x03 Register address:0x00C0-0x00C7
The voltage ratio can be corrected by this value when the voltage readingdeviationisgreaterthan1%.Thedefaultvalueis1000(3E8).
Forexample1:Theactualvoltageofchannel1is5.00V,butthereadvalue isonly4.00V.Theratiodeviationis5/4=1.25,andthecorrectionvoltage ratio is changed to 1250, which can correct the voltage.
Send frame: 010600C004E20B7F
Return frame: 010600C004E20B7F
The return frame is the same as the send frame. 07 means channel 1, 04 E2 means correction voltage ratio is 1250
Forexample2:Theactualvoltageofchannel1is4.00V,butthereadvalue isonly5.00V.Theratiodeviationis4/5=0.8,andthecorrectionvoltage ratio is changed to 800, which can correct the voltage.
Send frame: 010600C10320D91E
Return frame: 010600C10320D91E
The return frame is the same as the send frame. 08 means channel 2, 03
20 means correction voltage ratio is 800
1.Set the 485 address(Slave ID)
Send data
RS485 address (Station address) (1) |
Functio n (1) |
Register (2) |
|
address |
Read number (2) |
CRC16(2 ) |
Returns data |
|
|
|
|
|
|
RS485 address (Station address) (1) |
Functio n (1) |
Number (1) |
of |
bytes |
data (n) |
CRC16(2 ) |
Modbus Address(PLC):40254
RS485 address :0x01~0Xf8/0XFF
Function code:Write 0x06/0x10,Read 0x03
Register address:0x00FD(253)
Value: 2 bytes (values 1-248)
For example 1: Set the current device address to 0x02
Send data(address is 1): 01 06 00 FD 00 02 99 FB
Return data : 01 06 00 FD 00 02 99 FB
Send data(don't know the address): FF 06 00 FD 00 02 8C 25
Return data : FF 06 00 FD 00 02 8C 25
For example 2: Read device address(0X0001)
Send data : FF 03 00 FD 00 01 00 24 Return data : FF 03 02 00 01 50 50
Note:With this command, there can be only one module on the bus 485, More than one will go wrong!
2.Write baud rate Send data
RS485 address (Station address) (1) |
Functio n (1) |
Register (2) |
|
address |
Read number (2) |
CRC16(2 ) |
Returns data |
|
|
|
|
|
|
RS485 address (Station address) (1) |
Functio n (1) |
Number (1) |
of |
bytes |
data (n) |
CRC16(2 ) |
Modbus Address(PLC):40255
RS485 address :0x01~0x3F
Function code:Write 0x06/0x16;Read 0x03
Register address:0x00FE(254) Value: 2 bytes (values 0-7)
For example 1, Change the baud rate to 4800bps:
Send data(address 1):01 06 00 FE 00 02 69 FB
Return data :01 06 00 FE 00 02 69 FB
Baud rate corresponds to the number: 0:1200 1:2400 2:4800 3:9600
4:19200 5:38400 6:57600 7: 115200 8: Factory reset
Note: 1 The baud rate will be updated only when the module is powered on again when this command is used!
2 When the number corresponding to the baud rate is 8, the factory settings can be restored For example:01 06 00 FE 00 08 E9 FC
For example 2 Read the current baud rate:
Send data(address 1):01 03 00 FE 00 01 E5 FA Return data :01 03 02 00 03 F8 45
01RS485 address,03Function,02length,F845crc16,03 meansthecurrent baud rate is 9600bps
Baud rate corresponds to the number: 0:1200 1:2400 2:4800 3:9600 4:19200 5:38400 6:57600 7: 115200
3.Set Command(Date) Return Time Send data
RS485 address (Station address) (1) |
Functio n (1) |
Register (2) |
|
address |
Read number (2) |
CRC16(2 ) |
Returns data |
|
|
|
|
|
|
RS485 address (Station address) (1) |
Functio n (1) |
Number (1) |
of |
bytes |
data (n) |
CRC16(2 ) |
Modbus Address(PLC):40253
RS485 address :0x01~0x3F
Function code:Write 0x06/0x16;Read 0x03
Register address:0x00FC(252) Value: 2 bytes (values 0-25)
For example, set the data return delay to 200ms
Send data(address 1):01 06 00 FC 00 05 89 F9
Return data :01 06 00 FC 00 05 89 F9
Return the delay time calculation formula:X = 05 * 40 = 200MS
Note: The maximum can be set to 1000MS. If it exceeds 1000MS, that is, the setting value is greater than 25, and the data return delay will be initialized.
That is: 01 06 00 FC 00 20 48 22 can make the data return delay to restore initialization 0
4.Set Parity
Send data
RS485 address (Station address) (1) |
Functio n (1) |
Register (2) |
|
address |
Read number (2) |
CRC16(2 ) |
Returns data |
|
|
|
|
|
|
RS485 address (Station address) (1) |
Functio n (1) |
Number (1) |
of |
bytes |
data (n) |
CRC16(2 ) |
Modbus Address(PLC):40256
RS485 address :0x01~0x3F
Function code:Write 0x06/0x16;Read 0x03
Register address:0x00FF(255) Value: 2 bytes (values 0-2)
For example, set the parity to Even parity
Send data(address 1):01 06 00 FF 00 01 78 3A
Return data :01 06 00 FF 00 01 78 3A
0 None Parity 1 Even Parity 2 Odd Parity
Note: 1. When using this command, the module is powered on again, and the check digit will be updated!
2. When the setting is greater than 2, the default value will be restored to 0 after powering on again, and there will be no verification.
5.Factory reset: Send data
RS485 address (Station address) (1) |
Functio n (1) |
Register (2) |
|
address |
Read number (2) |
CRC16(2 ) |
Returns data |
|
|
|
|
|
|
RS485 address (Station address) (1) |
Functio n (1) |
Number (1) |
of |
bytes |
data (n) |
CRC16(2 ) |
Modbus Address(PLC):40252
RS485 address : 0x01~0x3F
Function code:Write 0x06;
Register address:0x00FB(251)
Send data(address 1):FF 06 00 FB 00 00 ED E5
Return data :FF 06 00 FB 00 00 ED E5
Hardware reset: Short the RES jumper of the board for 5 seconds, then power on again.